<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <title>管理后台</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
        <!-- 新 Bootstrap 核心 CSS 文件 -->
        <link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">

        <!-- 可选的Bootstrap主题文件（一般不用引入） -->
        <link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">

        <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
        <script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>

        <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
        <script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>        
        <link href="Public/admin/css/dashboard.css" rel="stylesheet">
        <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.11.1/bootstrap-table.min.css">
        
    </head>
    <body>
    <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container-fluid">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">管理后台</a>
        </div>
        <include file="./Public/admin/navbar.html" keywords="1" />

      </div>
    </nav>

    <div class="container-fluid">
      <div class="row">
         <div class="col-sm-2 col-md-2">
        <include file="./Public/admin/menu.html" keywords="1" />
         </div>
        <!--正式内容开始-->
        <div class="col-sm-9 col-md-10  main">
            <h1 class="page-header">提现列表</h1>          
                <P><a class="btn btn-danger" href="{:U(exchangeAdd)}">添加</a></p>                        
            <table id="table" ></table> 
        </div>
        <!--正式内容结束-->
      </div>
    </div>
        
        
  <div class="modal" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">拒绝内容</h4>
            </div>
            <div class="modal-body">
                <div class="form-group">
                    <label for="name"> 用户ID：</label>
                    <input value="" class="form-control user_id" readonly="true" type="text" ><br>
                </div>
                <div class="form-group">
                    <label for="name"> 拒绝内容：</label>
                    <textarea class="form-control msg_content" ></textarea>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" onClick="updata('false')">提交更改</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
  </div>
        
    <script src="http://cdn.bootcss.com/bootstrap-table/1.9.1/bootstrap-table.min.js"></script>
    <script src="http://cdn.bootcss.com/bootstrap-table/1.9.1/locale/bootstrap-table-zh-CN.min.js"></script>
    <script type="text/javascript">
        $('#table').bootstrapTable({
            url:'./index.php?m=center&c=exchange&a=exchangeList',
                 dataType: "json",
               
                silentSort:true,
                pagination:true,
                pageSize:50,
                search:true,
                showExport:true,
                filterControl:true,
                pageList: [10, 25, 50, 100],
                showRefresh: true,                  //是否显示刷新按钮
                clickToSelect: true,                //是否启用点击选中行
                uniqueId: "ID",                     //每一行的唯一标识，一般为主键列
                minimumCountColumns: 2,             //最少允许的列数
                showColumns: true,//列选择按钮
                /*
                 *                 pageList: [10, 25, 50, 100],        //可供选择的每页的行数（*）
                search: true,                       //是否显示表格搜索，此搜索是客户端搜索，不会进服务端，所以，个人感觉意义不大
                strictSearch: true,
                showColumns: true,                  //是否显示所有的列
                showRefresh: true,                  //是否显示刷新按钮
                minimumCountColumns: 2,             //最少允许的列数
                clickToSelect: true,                //是否启用点击选中行
                height: 500,                        //行高，如果没有设置height属性，表格自动根据记录条数觉得表格高度
                uniqueId: "ID",                     //每一行的唯一标识，一般为主键列
                showToggle: true,                    //是否显示详细视图和列表视图的切换按钮
                cardView: false,                    //是否显示详细视图
                detailView: false,                   //是否显示父子表
                 */
            columns: [{
                field: 'id',
                title: 'id',
                align : 'center',
                valign : 'middle'
            }, {
                field: 'exchange_name',
                title: '价钱',
                align : 'center',
                valign : 'middle'
                
            }, {
                field: 'exchange_desc',
                title: '描述',
                align : 'center',
                valign : 'middle'
            },{
                field: 'need_jf',
                title: '积分',
                align : 'center',
                valign : 'middle' 
            },{
                field: 'option',
                title: '编辑',
                align : 'center',
                valign : 'middle',
                formatter:function(value,row,index){  
                    $(".user_id").val(row.id);
                     var d = '<a href="./index.php?m=Center&c=Admin&a=delete&table=exchange_list&did='+row.id+'">删除</a> ';
                        return d;  
                    } 
            }    
            ]
        });
        

        function examine(val){
           $(".user_id").val(val);

        }
        
        function updata(check,id){
            var userID;
             if(id){
                 userID = id;
             }else{
                 userID = $(".user_id").val();
             }
             $.ajax({
                 type: "POST",
                 url: "index.php?m=Center&c=mz&a=mzExamine",
                 data: {
                     action:"mzExamine",
                     userId:userID, 
                     content:$(".msg_content").val(),
                     check:check
                 },
                 dataType: "json",
                 success: function(data){
                     $('#table').bootstrapTable('refresh');       
                 }
             }); 
        }
    </script>
    </body>
</html>
